/*
 * Copyright (C) 2019
 * <tang-haifeng@foxmail.com> <pengren.mcu@qq.com>
 *
 * SPDX-License-Identifier:	GPL-2.0+
 *
 */

#include <common.h>
#include <clk.h>
#include <led.h>
#include <miiphy.h>
#include <netdev.h>

#include <mach/ls1x.h>

DECLARE_GLOBAL_DATA_PTR;

#ifndef CONFIG_DM_ETH
extern int gmac_initialize(ulong base_addr, u32 interface);

int board_eth_init(bd_t *bis)
{
	int ret = 0;

#ifdef LOONGSON_GMAC0_EN
	ret = gmac_initialize(LS1X_GMAC0_BASE, LOONGSON_GMAC_PHY_MODE);
#endif
#ifdef LOONGSON_GMAC1_EN
	ret = gmac_initialize(LS1X_GMAC1_BASE, LOONGSON_GMAC_PHY_MODE);
#endif

	return ret;
}
#endif

int board_early_init_f(void)
{
	return 0;
}

int ls1x_board_late_init(void)
{
	return 0;
}
